﻿/// <reference path="../../Scripts/jquery-1.4.1-vsdoc.js" />

function delMaterial(id) {
	if (confirm("确定要删除这个物料吗？")) {
		$.post("/MaterialManagement/Delete", { "id": id }, ajaxSuccessed);
	}
}
function ajaxSuccessed(res) {
	if (res.Success) {
		//		window.location.replace(window.location);
		history.go(0);
	}
	else {
		alert(res.Message);
	}
}

function search() {
	var companyName = $("#companyName").val();
	var materialName = $("#materialName").val();
	var page = $("#page").val();
	page = page ? page : 1;
	var url = "/MaterialManagement/ViewMaterialList/?companyName=" + companyName
		+ "&materialName=" + materialName + "&page=" + page;
	window.location = url;
}